import request from '@/utils/request'
import { useCookieStore } from '@/stores/cookieStore'

// 获取 mv 排行榜
export const getTopMvApi = (data) => {
  return request({
    url :'/top/mv',
    params: {
      area: data.area,
      limit: 20,
      offset: data.offset
    }
  })
}

// 获取 mv 详情
export const getMvDetailApi = (id) => {
  const cookieStore = useCookieStore()
  return request({
    url: '/mv/detail',
    params: {
      mvid: id,
      cookie: cookieStore.cookie.cookie
    }
  })
}

// 获取 mv 的播放地址
export const getMvAddressApi = (data) => {
  return request({
    url: '/mv/url',
    params: {
      id: data.id,
      r: data.r
    }
  })
}